package com.bos.dao.impl;

import com.bos.dao.PengelolaDAO;
import com.bos.domain.Pengelola;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import javax.persistence.EntityNotFoundException;

/**
 * Created by IntelliJ IDEA.
 * User: Latief
 * Date: 3/15/11
 * Time: 9:32 PM
 * To change this template use File | Settings | File Templates.
 */
@Repository
//@Service("springSecurityService")
//@Transactional
public class PengelolaDAOImpl extends GenericDAOImpl<Pengelola> implements PengelolaDAO {
    public PengelolaDAOImpl() {
        super(Pengelola.class);
    }

    @Override
    public Pengelola findByUsername(String username) throws DataAccessException,EntityNotFoundException {
        return (Pengelola) this.entityManager.createQuery("SELECT o FROM Pengelola o WHERE o.username=:username").setParameter("username", username).getSingleResult();
    }
}
